/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package vista;

import control.Control;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

/**
 *
 * @author alumneDAM
 */
public class PanelNuevaPartida extends javax.swing.JPanel {

    /**
     * Creates new form NuevaPartida
     */
    Control control;

    public PanelNuevaPartida(Control control) {
        this.control = control;
        initComponents();
        this.btn_buscar.setActionCommand("BuscarJugador");
        this.btn_buscar.addActionListener(control);
        
//        this.btn_partidaAzar.setActionCommand("BuscarJugadorAzar");
//        this.btn_partidaAzar.addActionListener(control);
    }

    public JTextField getTxt_buscar() {
        return txt_buscar;
    }
    public void muestraError(){
        JOptionPane.showMessageDialog(null, "No Existe el Jugador", "Error", JOptionPane.INFORMATION_MESSAGE);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lbl_nuevaPartida = new javax.swing.JLabel();
        lbl_buscar = new javax.swing.JLabel();
        btn_buscar = new javax.swing.JButton();
        txt_buscar = new javax.swing.JTextField();

        lbl_nuevaPartida.setText("Configurar nueva partida");

        lbl_buscar.setText("Buscar por usuario:");

        btn_buscar.setText("Buscar");

        txt_buscar.setText("Texto");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(146, 146, 146)
                        .addComponent(lbl_nuevaPartida))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lbl_buscar)
                        .addGap(18, 18, 18)
                        .addComponent(txt_buscar, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 19, Short.MAX_VALUE)
                .addComponent(btn_buscar)
                .addGap(47, 47, 47))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbl_nuevaPartida)
                .addGap(61, 61, 61)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(btn_buscar)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lbl_buscar)
                        .addComponent(txt_buscar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(232, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_buscar;
    private javax.swing.JLabel lbl_buscar;
    private javax.swing.JLabel lbl_nuevaPartida;
    private javax.swing.JTextField txt_buscar;
    // End of variables declaration//GEN-END:variables
}
